package swingtest;

import java.awt.BorderLayout;
import java.awt.Container;

import javax.swing.JButton;
import javax.swing.JFrame;

public class J_BorderLayout {

	public static void main(String[] args) {
		JFrame app = new JFrame("J_BorderLayout");
		app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		app.setSize(360, 130);
		app.setLocationByPlatform(true);
		Container container = app.getContentPane();
		container.setLayout(new BorderLayout(2,2));
		container.add(new JButton("东"),BorderLayout.EAST);
		container.add(new JButton("西"),BorderLayout.WEST);
		container.add(new JButton("南"),BorderLayout.SOUTH);
		container.add(new JButton("北"),BorderLayout.NORTH);
		container.add(new JButton("中"),BorderLayout.CENTER);
		app.setVisible(true);
	}

}
